<?php

Class Test extends Controller 
{ 
    public $sample_var = 'this is sample var !';
    
    function __construct()
    {   
        parent::__construct();
        parent::__user();                  
                                             
        loader::base_helper('form');     // load helper from /base directory  
        loader::base_helper('url'); 
        
    }                               
    
    function index()
    {                    
        $this->title_tag = 'This is the default function test/test/index ! (defined in config/routes.php)';  // look at /User folder
        $this->head_tag  = loader::script('test'); 
    
        $data['example_var'] = 'example var works !';
        
        $this->body_tag  = loader::view('view_index',$data);
        loader::app_view('view_base'); 
    }
    
    function run()
    {
        $this->head_tag  = loader::source_css(array('obullo','example'));
        $this->head_tag .= loader::source_js('jquery');
        $this->head_tag .= loader::script('test');
          
        $this->title_tag = 'Im the Test2 Controller !';  
                
        $data['sample_array'] = array('1','2','3','4','5');
        $data['example_var']  = 'Hello World!';
                
        $this->body_tag = loader::view('view_test',$data);
        loader::app_view('view_base');
    }
        
        
    function test_helper()
    {
        loader::user_helper('user');     // load class helper from /user directory 
        loader::lib('test_lib');   
        
        echo user::test_lib();
    }
        
} //end of the class.
  
  
?>
